﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Adm.Master" Theme="Adm" AutoEventWireup="true" CodeBehind="consultaUnidadeCadastrada.aspx.cs" Inherits="PROAD.admin.Consulta.consultaUnidadeCadastrada" %>
<asp:Content ID="Content1" ContentPlaceHolderID="IncludeHead" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="IncludeTitulo" runat="server">
<h1>Lista de Unidades de Saúde Cadastradas</h1>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="IncludeLink" runat="server">
<h1><a href="/admin/Forms/FormUsb.aspx">Nova US</a></h1>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="IncludeConteudo" runat="server">
        
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        
        <table width="100%">
            <tr>
                <td>
                Nome
                </td>
                <td>
                UF
                </td>
                <td>
                Município
                </td>
                <td>
                &nbsp;
                </td>
            </tr>
             <tr>
                <td>
                <asp:TextBox ID="txtNome" runat="server" Width="247px"></asp:TextBox>
                </td>
                <td>
                    <asp:DropDownList ID="ddlUf" runat="server" Width="89px" 
                        onselectedindexchanged="ddlUf_SelectedIndexChanged" 
                        DataValueField="CO_UF" DataTextField="NO_SIGLA"
                        AutoPostBack="true">
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:DropDownList ID="ddlMunicipio" runat="server" Width="138px"
                            DataValueField="CO_CIDADE" DataTextField="NO_CIDADE">
                         </asp:DropDownList>
                </td>
                 
                <td>
                    <asp:Button ID="btnPesquisar" runat="server" Text="Pesquisar US" Width="103px" 
                        onclick="btnPesquisar_Click"/>
                </td>
             </tr>
             <tr>
              <td colspan="4"> &nbsp;</td>
             </tr>
             <tr>
              <td colspan="4"> 
                <%--Grid com resultados--%>
                  <asp:GridView ID="gridUs" runat="server" CellPadding="4" ForeColor="#333333" 
                      GridLines="None" SkinID="GridAdm" AutoGenerateColumns="false" 
                      onrowcommand="gridUs_RowCommand" 
                      EmptyDataText="<center>Não foram encontrados registros!</center>" 
                      onrowdatabound="gridUs_RowDataBound">
                      
                      <Columns>
                        <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkStatus" runat="server" CommandName="Status"
                                    CommandArgument='<%#Eval("CO_US")%>' Visible="True">
                                    <img alt="Status" border="0" src="../../common/imagem_sis/imagem_sis/<%#Eval("NR_STATUS").ToString() == "0" ? "inativo.png" : "ativo.png"%>" />
                                </asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="13px" Width="40px" Font-Names="Verdana"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Center" />
                        </asp:TemplateField> 
                
                        <asp:BoundField DataField="NO_US" HeaderText="Nome">
                            <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
                        </asp:BoundField>

                        <asp:BoundField DataField="NO_REGIAO" HeaderText="Região">
                            <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
                        </asp:BoundField>
                        
                        <asp:BoundField DataField="CO_MUNICIPIO" HeaderText="Cidade">
                            <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
                        </asp:BoundField>

                        <asp:BoundField DataField="CO_UF" HeaderText="UF">
                            <HeaderStyle Font-Size="13px" Font-Names="Verdana" HorizontalAlign="Left"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Left" />
                        </asp:BoundField>

                        <asp:TemplateField HeaderText="">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkEditar" runat="server" CommandName="Editar"
                                    CommandArgument='<%#Eval("CO_US")%>' Visible="True">
                                    <img alt="Status" border="0" src="../../common/imagem_sis/imagem_sis/editar.png" />
                                </asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle Font-Size="13px" Width="40px" Font-Names="Verdana"/>
                            <ItemStyle Font-Size="10pt" HorizontalAlign="Center" />
                        </asp:TemplateField>
                                              
                      </Columns>
                                            
                  </asp:GridView>

              </td>
             </tr>
        </table>

        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="IncludeRodape" runat="server">
</asp:Content>
